Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting minitest #68

Closed
wants to merge 8 commits into from
Closed

Supporting minitest #68

wants to merge 8 commits into from

Conversation

umuro
Copy link

@umuro umuro commented Aug 28, 2012

Added minitest support. Otherwise it's not possible to use mini test with factory girl fixtures. Maybe this gem should not touch the test framwork setups at all?

@Linuus
Copy link

Linuus commented Aug 28, 2012

Thank you! Just got crazy over this problem. Using your fork for now :)

@blowmage
Copy link

Can we get this (or something like it) accepted? I've had two questions about this in the past day.

http://stackoverflow.com/questions/12148611/rails-generators-not-generating-the-proper-test-templates
http://stackoverflow.com/questions/12157437/minitest-rails-generators

@jonesdeini
Copy link

Here is my fix: jonesdeini@fe632cf
It's very general and works with test_unit or mini_test.

@blowmage
Copy link

+1 for @jonesdeini's fix.

…mally. They are not touched here. +1 for @joedesini
@umuro
Copy link
Author

umuro commented Aug 29, 2012

I've merged @jonesdeini's fix.
MiniTesting with FactoryGirl now. Just having normal configuration in my application.rb

DemoBlogHobo::Application.configure do
  config.generators do |g|
    g.test_framework :mini_test, :spec => true, :fixture=>false, :fixture_replacement=>:factory_girl
  end
end

@mike-burns
Copy link
Member

This breaks features/fixture_replacement_config.feature:18 because it no longer generates the factory file correctly.

@umuro
Copy link
Author

umuro commented Sep 4, 2012

Why "it no longer generates the factory file correctly"?

There is no code touching the factory file. Just test framework settings
are no more overridden!

How can we use minitest (not unitest) while enjoying factory girl fixtures?

On Tue, Sep 4, 2012 at 11:59 AM, Mike Burns notifications@github.comwrote:

This breaks features/fixture_replacement_config.feature:18 because it no
longer generates the factory file correctly.


Reply to this email directly or view it on GitHubhttps://github.com//pull/68#issuecomment-8257941.

Umur Ozkul
mobile: +31 62 134 1113
skype: umurozkul
google talk: umur.ozkul

http://conceptspace.wikidot.com

@umuro
Copy link
Author

umuro commented Sep 4, 2012

Why "it no longer generates the factory file correctly"? Or in which
conditions?

On Tue, Sep 4, 2012 at 12:22 PM, Umur Ozkul umur.ozkul@gmail.com wrote:

Why "it no longer generates the factory file correctly"?

There is no code touching the factory file. Just test framework settings
are no more overridden!

How can we use minitest (not unitest) while enjoying factory girl fixtures?

On Tue, Sep 4, 2012 at 11:59 AM, Mike Burns notifications@github.comwrote:

This breaks features/fixture_replacement_config.feature:18 because it no
longer generates the factory file correctly.


Reply to this email directly or view it on GitHubhttps://github.com//pull/68#issuecomment-8257941.

Umur Ozkul
mobile: +31 62 134 1113
skype: umurozkul
google talk: umur.ozkul

http://conceptspace.wikidot.com

Umur Ozkul
mobile: +31 62 134 1113
skype: umurozkul
google talk: umur.ozkul

http://conceptspace.wikidot.com

@mike-burns
Copy link
Member

The reason I know the test is failing is because I tried to merge this, because we want this feature.

It's worth noting that this branch did not merge cleanly. Perhaps if you rebase against master you will do a better job resolving conflicts than I.

This is the failure I see. I do not see it in master, only in this branch:

~/thoughtbot/factory_girl_rails% ruby -v
ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-linux]
~/thoughtbot/factory_girl_rails% rake
/home/mike/.rvm/rubies/ruby-1.9.2-p320/bin/ruby -S bundle exec cucumber --format progress
........F-.................................................

(::) failed steps (::)

expected file?("test/factories/users.rb") to return true, got false (RSpec::Expectations::ExpectationNotMetError)
features/fixture_replacement_config.feature:18:in `Then the following files should exist:'

Failing Scenarios:
cucumber features/fixture_replacement_config.feature:14 # Scenario: Using Factory Girl and Factory Girl Rails with Test Unit generates
a factory file and does not generate a fixture file

5 scenarios (1 failed, 4 passed)
49 steps (1 failed, 1 skipped, 47 passed)
1m10.920s
rake aborted!
Command failed with status (1): [/home/mike/.rvm/rubies/ruby-1.9.2-p320/bin...]

Tasks: TOP => default => cucumber
(See full trace by running task with --trace)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants